/*
 * main.cpp
 *
 *  Created on: Sep 30, 2022
 *      Author: tau
 */
#include <stdio.h>
#include <pthread.h>
#include "board.h"
#include "psUart.h"
#include "time.h"

using namespace std;
psUart* __tty;
void _callback(char* data){
	printf("gui rxed : %s\r\n",data);

}

int main() {
	boardInit();
	uint32_t i;
	char dataBuf[128];

	__tty = new psUart("/dev/ttyS3",B1000000,"+","-\r\n","#","*",_callback);
	i=0;
	while(1){
		onEvent();
		usleep(150000);
		sleep(1);
		snprintf(dataBuf,128,"counter :%ld",i);
		i++;
		__tty->sendData(dataBuf);
	}
	return 0;
}
